// 一、将下面异步代码使用Promise的方法改进
setTimeout(function () {
  var a = 'hello'
  setTimeout(function () {
    var b = 'lagou'
    setTimeout(function () {
      var c = 'I❤️U'
      console.log('setTimeout' ,a + b + c)
    }, 1000)
  }, 1000)
}, 1000)

// Promise 改进
function print(text) {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve(text)
    }, 1000)
  })
}

print('hello').then(value => {
  return print(`${value}lagou`)
}).then((value) => {
  return print(`${value}I❤️U`)
}).then((value) => {
  console.log('Promise', value)
})